/**
 * 
 */
package com.jiuqi.irs.logic.account;

import java.util.ArrayList;
import java.util.Collection;

import com.jiuqi.ccp.generator.logic.BaseBO;
import com.jiuqi.common.StringUtils;
import com.jiuqi.irs.formbean.beanutil.TbPayeeaccountBeanUtil;
import com.jiuqi.irs.formbean.form.TbPayeeaccountExtForm;
import com.jiuqi.irs.generator.dao.TbPayeeaccountDAO;
import com.jiuqi.irs.generator.dao.pojo.TbPayeeaccount;

/**
 * @author liuwenxue
 *
 */
public class PayeeAccountBO extends BaseBO implements PayeeAccountBOI {
	protected TbPayeeaccountDAO tbPayeeaccountDAO;

	public void setTbPayeeaccountDAO(TbPayeeaccountDAO tbPayeeaccountDAO) {
		this.tbPayeeaccountDAO = tbPayeeaccountDAO;
	}

	public ArrayList getAccountByOrgCode(String orgCode,String year) {
		ArrayList retList = new ArrayList();
		if(!StringUtils.isEmpty(orgCode)){
			StringBuffer sHql = new StringBuffer();
			sHql.append("from TbPayeeaccount tb where tb.orgCode='").append(orgCode).append("'");
			Collection cols = tbPayeeaccountDAO.getTbPayeeaccountByHql(sHql.toString());
			if(cols!=null&&cols.size()>0){
				TbPayeeaccount pojoTbPayeeaccount = (TbPayeeaccount)cols.iterator().next();
				TbPayeeaccountExtForm formTbPayeeaccount = TbPayeeaccountBeanUtil.convertPojo2Form(pojoTbPayeeaccount);
				retList.add(formTbPayeeaccount);
			}
		}
		return retList;
	}




	
}
